<template>
  <sn-three-col-space>
    <div slot="spaceContent">
      <el-divider><i class="el-icon-s-order"></i></el-divider>
      <me-order-template
          :item="item"
          v-for="item in items"></me-order-template>
    </div>
  </sn-three-col-space>
</template>

<script>
import MeOrderTemplate from "@/views/order/me_order/template/MeOrderTemplate";



export default {
  name: "MeOrder",
  components: {
    MeOrderTemplate
  },
  created() {
    this.getOrderItems()
  },
  data() {
    return {
      items: []
    }
  },
  methods: {
    getOrderItems() {
      let userId = this.$store.getters.getUser.userId
      this.$http({
        url: `/order/orders/getByUserIdFindOrderInfo/${userId}`,
        method: 'get',
      }).then(({data}) => {

        this.items = []
        let page = data.orderAll
        for (let i = 0; i < page.length; i++) {
          this.items.push(page[i])
        }
      })
    }
  },
}
</script>

<style scoped>

</style>
